package com.pan.kang.bean;

import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.SearchBean;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@SearchBean(
        tables = "employee e, department d",
        where = "e.department_id = d.id",
        autoMapTo = "e"                            // 字段没使用 DbField 注解时，自动映射到 employee 表
)
@Data
public class EmployeeSearcherBean {
    /**
     * 自动映射到 "e.id"
     */
    private Long id;
    /**
     * 自动映射到 "e.name"
     */
    private String name;
    /**
     * 自动映射到 "e.age"
     */
    private Integer age;
    /**
     * 自动映射到 "e.gender"
     */
    private String gender;
    /**
     * 自动映射到 "e.entry_date"
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date entryDate;

    @DbField("d.name")
    private String departmentName;

    @DbField("d.id")
    private Long departmentId;



}

